package com.lry.basic.proxy.demo1;


public class Test {
    public static void main(String[] args) {

        UserService userService = (UserService) ProxyUtils.newInstance(UserService.class,new TransactionalInvocationHandler(new UserServiceImpl()));
        try {
            System.out.println(userService.queryById(10));
        } catch (Exception e) {
            e.printStackTrace();
        }

//        UserService userService = (UserService) ProxyUtils.newInstance(UserService.class,new TransactionalInvocationHandler(new UserServiceImpl()));
//        try {
//            System.out.println(userService.test());
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
    }
}
